package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.DevAlarmRecordDao;
import com.sugon.entity.DevAlarmRecordEntity;
import com.sugon.service.DevAlarmRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * ${comments}Service实现类
 *
 * @author YuXD
 * @date 2020-05-17 22:41:26
 */
@Service("devAlarmRecordService")
public class DevAlarmRecordServiceImpl implements DevAlarmRecordService {
    @Autowired
    private DevAlarmRecordDao devAlarmRecordDao;

    /**
     * queryObject
     *
     * @param id 主键
     * @return
     */
    @Override
    public DevAlarmRecordEntity queryObject(Integer id) {
        return devAlarmRecordDao.queryObject(id);
    }

    /**
     * queryList
     *
     * @param map 参数
     * @return
     */
    @Override
    public List<DevAlarmRecordEntity> queryList(Map<String, Object> map) {
        return devAlarmRecordDao.queryList(map);
    }

    /**
     * queryTotal
     *
     * @param map 参数
     * @return
     */
    @Override
    public int queryTotal(Map<String, Object> map) {
        return devAlarmRecordDao.queryTotal(map);
    }

    /**
     * save
     *
     * @param devAlarmRecord 实体
     * @return
     */
    @Override
    public int save(DevAlarmRecordEntity devAlarmRecord) {
        devAlarmRecord.setId(RandomUtil.randomString(32));
        return devAlarmRecordDao.save(devAlarmRecord);
    }

    /**
     * update
     *
     * @param devAlarmRecord 实体
     * @return
     */
    @Override
    public int update(DevAlarmRecordEntity devAlarmRecord) {
        return devAlarmRecordDao.update(devAlarmRecord);
    }

    /**
     * delete
     *
     * @param id
     * @return
     */
    @Override
    public int delete(Integer id) {
        return devAlarmRecordDao.delete(id);
    }

    /**
     * deleteBatch
     *
     * @param ids
     * @return
     */
    @Override
    public int deleteBatch(Integer[] ids) {
        return devAlarmRecordDao.deleteBatch(ids);
    }
}
